{extend name='admin@main'}

{block name="button"}

{if auth("coupons/score_rule/add")}
<button data-modal='{:url("add")}' data-title="添加积分规则" class='layui-btn layui-btn-sm layui-btn-primary'>添加积分规则</button>
{/if}

{if auth("coupons/score_rule/del")}
<button data-action='{:url("del")}' data-rule="id#{key}" data-csrf="{:systoken('coupons/score_rule/del')}" data-confirm="确定要删除这些积分规则吗？" class='layui-btn layui-btn-sm layui-btn-primary'>删除积分规则</button>
{/if}

{/block}

{block name="content"}
<table class="layui-table" lay-skin="line">
    <caption class="margin-bottom-10 text-left">{include file='card/index_search'}</caption>
    {notempty name='list'}
    <thead>
    <tr>
        <th class='list-table-check-td think-checkbox'>
            <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
        </th>
        <th class='text-left nowrap' style="width:300px">ID</th>
        <th class='text-left nowrap' style="width:300px">规则名</th>
        <th class='text-left nowrap' style="width:300px">规则描述</th>
        <th class='text-left nowrap' style="width:300px">积分数量</th>
        <th class='text-left nowrap' style="width:300px">创建时间</th>
        <th class='text-left nowrap'></th>
    </tr>
    </thead>
    {/notempty}
    <tbody>
    {foreach $list as $key=>$vo}
    <tr data-dbclick>
        <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
       <td class='text-left nowrap'>
            {$vo.id|default=''}
        </td>
        <td class='text-left nowrap'>
            {$vo.title|default=''}
        </td>
        <td class='text-left nowrap'>
            {$vo.desc|default=''}
        </td>
        <td class='text-left nowrap'>
            {$vo.score|default=''}
        </td>
        <td class='text-left nowrap'>
            {$vo.create_time}
        </td>
        <td class='text-left nowrap'>
            {if auth("coupons/score_rule/edit")}
            <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑积分规则" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
            {/if}

            {if auth("coupons/score_rule/del")}
            <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该积分规则吗？" data-action="{:url('del')}" data-value="id#{$vo.id}" data-csrf="{:systoken('coupons/score_rule/del')}">删 除</a>
            {/if}
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>

{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

{/block}